//BZOJ 2391
#include <bits/stdc++.h>

using namespace std;

const int maxn=2005;
const double eps=1e-7;
inline double dcmp(const double &d){if(fabs(d)<eps) return 0;else return d>0?1:-1;}
struct Point{
    int x,y,id;
    Point(int x=0,int y=0):x(x),y(y){}
    const Point operator - (const Point &p) const{return Point(x-p.x,y-p.y);}
    const bool operator < (const Point &p) const;
};
Point orig=Point(-10023,-10086);
Point pts[maxn];
int val[maxn],rt[maxn],pos[maxn],ply[maxn];
int f[maxn][maxn];

inline double cross(const Point &p,const Point &q){return p.x*q.y-p.y*q.x;}
inline double dis(const Point &p){return sqrt(p.x*p.x+p.y*p.y);}
const bool Point::operator<(const Point &p) const{return dcmp(cross(*this-orig,p-orig))==0?dcmp(dis(*this-orig)-dis(p-orig))<0:dcmp(cross(*this-orig,p-orig))>0;}

//BST related
const int mxnde=maxn*maxn;
int v[mxnde],ch[mxnde][2],key[mxnde],cnt_nde,initV[mxnde];
int pnt[mxnde];
inline int node(const int &val,const int &p){cnt_nde++;ch[cnt_nde][0]=ch[cnt_nde][1]=0;v[cnt_nde]=initV[cnt_nde]=val;key[cnt_nde]=rand();pnt[cnt_nde]=p;return cnt_nde;}
inline void update(const int &nd){v[nd]=initV[nd]+v[ch[nd][0]]+v[ch[nd][1]];}
void rot(int &nd,const bool &d){
    int cur=nd;
    nd=ch[nd][!d];
    ch[cur][!d]=ch[nd][d];
    ch[nd][d]=cur;
    update(cur);
    update(nd);
}
int ins(int &nd,const int &p,const int &base,const int &val){
    if(!nd) return nd=node(val,p),0;
    bool d;int t;
    if((t=dcmp(cross(pts[pnt[nd]]-pts[base],pts[p]-pts[base])))<0||(t==0&&dcmp(dis(pts[pnt[nd]]-pts[base])-dis(pts[p]-pts[base]))<0)) d=1; else d=0;
    int ans;
    if(d) ans=v[ch[nd][0]]+initV[nd]+ins(ch[nd][1],p,base,val);
    else ans=ins(ch[nd][0],p,base,val);
    if(key[ch[nd][d]]<key[nd]) rot(nd,!d);
    update(nd);
    return ans;
}

inline int read(){
    char c;int r;bool f=0;
    for(c=getchar();c>'9'||c<'0';c=getchar()) if(c=='-') f=1;
    for(r=0;c<='9'&&c>='0';c=getchar()) r=r*10+c-'0';
    if(f) return -r;
    else return r;
}

int main(){
    int n,m,N,q;

    n=read();m=read();
    N=n+m;
    for(int i=0;i<n;i++) pts[i].x=read(),pts[i].y=read();
    for(int i=n;i<N;i++) pts[i].x=read(),pts[i].y=read(),val[i]=read();
    for(int i=0;i<N;i++) pts[i].id=i;
    sort(pts,pts+N);
    for(int i=0;i<N;i++) pos[pts[i].id]=i;

    for(int i=0;i<N;i++)
        for(int j=i+1;j<N;j++)
            f[i][j]=f[j][i]=ins(rt[i],j,i,val[pts[j].id]);

    //printf("pts:\n");
    //for(int i=0;i<N;i++) printf("%d: (%d,%d)\n",i,pts[i].x,pts[i].y);
    //for(int i=0;i<N;i++,putchar('\n'))
    //    for(int j=0;j<N;j++)
    //        printf("f[%d][%d]=%d ",i,j,f[i][j]);

    q=read();
    while(q--){
        m=read();
        for(int i=0;i<m;i++) ply[i]=read()-1;
        ply[m]=ply[0];
        int ans=0;
        for(int i=0;i<m;i++) if(dcmp(cross(pts[pos[ply[i]]]-orig,pts[pos[ply[i+1]]]-orig))>0) ans+=f[pos[ply[i]]][pos[ply[i+1]]]; else ans-=f[pos[ply[i]]][pos[ply[i+1]]];
        if(ans<0) ans=-ans;
        printf("%d\n",ans);
    }
}
